from django.conf.urls import url, include
from django.contrib import admin

from . import views

urlpatterns = [

    #1注册功能
    url(r'^register/$',views.RegisterView.as_view(),name="register"),

    #2判断用户是否重复 /usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/

    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$',views.UsernameCountView.as_view(),name="UsernameCount"),

    #3 判断手机号是否重复 /mobiles/(?P<mobile>1[3-9]\d{9})/count/
    url(r'^mobile/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view(),
        name="mobile"),

    #4.登陆功能 login
    url(r'^login/$', views.LoginView.as_view(), name="login"),

    # 5.退出功能 logout
    url(r'^logout/$', views.LogoutView.as_view(), name="logout"),

    # 6.个人中心 info
    url(r'^info/$', views.UserInfoView.as_view(), name="info"),

    # 7.修改邮箱
    url(r'^emails/$', views.EmailView.as_view(), name="email"),

    # 8.激活邮箱 emails/verification/
    url(r'^emails/verification/$', views.VerifyEmailView.as_view(), name='verify_emails'),

    #9.显示收货地址 address
    url(r'^address/$', views.AddressView.as_view(), name='address'),

    #10新增地址 addresses/create/
    url(r'^addresses/create/$', views.CreateAddressView.as_view(), name='create_address'),

    #11修改 和 删除地址 /addresses/(?P<address_id>\d+)/
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view(), name='create_address'),

    # 12 设置默认地址
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view(), name='default_address'),

    # 13 设置标题
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.TitleAddressView.as_view(), name='title_address'),

    # 14 显示修改密码页面 	/password/
    url(r'^password/$', views.ChangePwdView.as_view(), name="password"),

    # 15 浏览记录 	browse_histories/
    url(r'^browse_histories/$', views.HistoriesBrowseView.as_view(), name="browse"),

]